Skip to content

ddprof TaskBlock bridge and lock-support / object-wait instrumentations#11247

Draft
kaahos wants to merge 24 commits into
masterfrom
paul.fournillon/wallclock-signals-mitigation
Draft

ddprof TaskBlock bridge and lock-support / object-wait instrumentations#11247
kaahos wants to merge 24 commits into
masterfrom
paul.fournillon/wallclock-signals-mitigation

Conversation

@kaahos
Copy link
Copy Markdown

@kaahos kaahos commented Apr 30, 2026

What Does This Do

  • Extends ProfilingContextIntegration with getCurrentTicks, recordTaskBlock, parkEnter, parkExit and wires DatadogProfilingIntegration -> DatadogProfiler -> JavaProfiler.
  • Adds lock-support instrumentation (Instrumenter.ForBootstrap): LockSupport.park* / unpark, using bootstrap helpers (LockSupportHelper) for unpark -> park span handoff; parkEnter runs even without an active span so native code can track parked intervals; datadog.TaskBlock emission stays in java-profiler (duration / span gates).
  • Adds object-wait instrumentation.
  • Registers integration toggles in metadata/supported-configurations.json: DD_TRACE_LOCK_SUPPORT_ENABLED, DD_TRACE_OBJECT_WAIT_ENABLED (defaults true).

Motivation

java-profiler avoids firing wall-clock samples on threads that are clearly idle in sleep or park, and it can emit datadog.TaskBlock events for blocked time. The Java agent has to call the new JNI entry points with timing and span context so those TaskBlock events match real tracing work.

Additional Notes

  • linked PR: java-profiler must ship the matching ddprof artifact (JNI + native).
  • encode / encodeOperationName / encodeResourceName behavior remains 0 for ddprof (same as prior ProfilingContextIntegration defaults); comment clarifies intent.
  • Object.wait: only wait(long) is instrumented, wait() / wait(long, int) route through it on HotSpot.

Contributor Checklist

Jira ticket: [PROf-14354]

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels the queue request. /merge -f --reason "reason" skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.

@kaahos kaahos self-assigned this Apr 30, 2026
@kaahos kaahos force-pushed the paul.fournillon/wallclock-signals-mitigation branch from bf909b9 to 769b169 Compare May 3, 2026 15:42
@kaahos kaahos force-pushed the paul.fournillon/wallclock-signals-mitigation branch from e60eeb3 to e2f9451 Compare May 3, 2026 17:35
@kaahos kaahos force-pushed the paul.fournillon/wallclock-signals-mitigation branch from cacbd64 to c210dd3 Compare May 4, 2026 13:27
@kaahos kaahos force-pushed the paul.fournillon/wallclock-signals-mitigation branch from c210dd3 to 0084005 Compare May 4, 2026 16:22
@kaahos kaahos force-pushed the paul.fournillon/wallclock-signals-mitigation branch from 70aed84 to fb099b6 Compare May 7, 2026 13:36
@kaahos kaahos force-pushed the paul.fournillon/wallclock-signals-mitigation branch 2 times, most recently from 5cee2ee to f3dddfb Compare May 11, 2026 21:15
@kaahos kaahos force-pushed the paul.fournillon/wallclock-signals-mitigation branch from f3dddfb to 584d2fc Compare May 11, 2026 22:29
@kaahos kaahos changed the title Add profiler integration for wall-clock signal suppression and TaskBlock events ddprof TaskBlock bridge and lock-support / object-wait instrumentations May 11, 2026
@dd-octo-sts dd-octo-sts Bot deleted a comment from github-actions Bot May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant